home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / ftp_mput.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.3 KB  |  43 lines

  1. ## ftp_mput.tg
  2. # Multi-file Put with wildcards
  3. # script assumes:
  4. # 1. There is a temp/foo directory on the remote server 
  5. # 2. There is a c:\temp\foo local directory filled with all the files you wish to Put.
  6. # 3. the environment variables: USER.SERVER, USER.USERID, and USER.PASSWORD are set elsewhere,
  7. #    perhaps in the global (computer) environment or the local environment of WinCron via 
  8. #    Config.tg or AutoRun.tg. You could also set them here in this this script or hard-code the 
  9. #    values passed to -ftp connect.
  10.  
  11. # mput some files
  12. {
  13.     -name ftp_mput
  14.     -start 
  15.     -stop
  16.     -action -print connecting to remote ftp server
  17.     -action -onerror connect_fail
  18.     -action -ftp connect handle %USER.SERVER% 21 %USER.USERID% %USER.PASSWORD%
  19.     -action -print putting files on remote ftp server
  20.     -action -onerror operation_fail
  21.     -action -ftp mput handle c:\temp\foo\*.* temp/foo 0
  22.     -action -ftp close handle 
  23.     -action -print done!
  24. }
  25.  
  26. # connection failed
  27. {
  28.     -name connect_fail
  29.     -action -print FTP open connection failed with error:
  30.     -action -print %TG.LAST_ERROR%
  31.     -action -return abort
  32. }
  33.  
  34. # operation failed
  35. {
  36.     -name operation_fail
  37.     -action -print FTP mput failed with error:
  38.     -action -print %TG.LAST_ERROR%
  39.     -action -print Closing connection.
  40.     -action -ftp close handle
  41.     -action -return abort
  42. }
  43.